﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AdminController;

namespace HPMDesktop.Admin.Wards
{
    public partial class frmWard : Form
    {
        public frmWard()
        {
            InitializeComponent();
        }

       
        private void frmWard_Load(object sender, EventArgs e)
        {
            string ID;

            //ID = Request.Form("ID");
            ID = "1";

            Ward objData = new Ward();
            Ward_DataLoader objDataLoader = new Ward_DataLoader();

            try
            {

                objData = objDataLoader.Get_Ward_DATA(ID);

                WardName.Text = Convert.ToString(objData.WardName);
                Location.Text = Convert.ToString(objData.Location);
                WardType.Text = Convert.ToString(objData.WardType);
                NumberOfBeds.Text = Convert.ToString(objData.NumberOfBeds);
                Remarks.Text = Convert.ToString(objData.Remarks);
            }
            catch (Exception ex)
            {

            }
            finally
            {
                objData.Dispose();
                objDataLoader.Dispose();

            }

        }

        private void cmdSave_Click(object sender, EventArgs e)
        {
            bool result;
            Ward objData = new Ward();
            Ward_Mapper objMapper = new Ward_Mapper();

            objData.WardID = "1";

            try
            {
                objData.WardName = Convert.ToString(WardName.Text);
                objData.Location = Convert.ToString(Location.Text);
                objData.WardType = Convert.ToString(WardType.Text);
                objData.NumberOfBeds = Convert.ToString(NumberOfBeds.Text);
                objData.Remarks = Convert.ToString(Remarks.Text);

                result = objMapper.Load_Ward_DATA(objData.WardID, objData);
            }
            catch (Exception ex)
            {

            }
            finally
            {
                objData.Dispose();
                objMapper.Dispose();

            }

        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }


    }
}
